 <?php 
if(!isset($_SESSION)) @session_start();
     
$StudyYear=$_SESSION["study_year"];
$ProspectusCode=$_SESSION["ProspectusCode"];

$data_file = "{$_SERVER["DOCUMENT_ROOT"]}/modules/search_box/data/ObtainProspectus_{$StudyYear}_{$ProspectusCode}.json";
if (!file_exists($data_file)) {
    $params = "StudyYear={$StudyYear}&ProspectusCode={$ProspectusCode}";
    $feed = "http://{$_SERVER['SERVER_NAME']}/WebServices/PRC/service.asmx/ObtainProspectus?{$params}"; 
    $xml = simplexml_load_file($feed);
    file_put_contents($data_file, json_encode($xml));
}   

//$json = json_encode($xml);
 
//echo $json;
echo file_get_contents($data_file);
?>